﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;

namespace MS.InformationManagement.Presenter.SelectFileLibrary
{
    public class SelectFileLibraryPresenter : BasePresenter<ISelectFileLibraryView>
    {

        #region Constructors

        public SelectFileLibraryPresenter(ISelectFileLibraryView view) : base(view) { }

        #endregion

        #region Public Methods

        public void HandleLoad()
        {
            this.SearchDocuments();
            View.Show();
        }

        public void SearchDocuments()
        {
            int totalRecords;
            View.Files = new BLL.SelectfileLibrary.SelectFileLibrary().GetFilesCurrentLibrary(View.PageIndex, View.PageSize, out totalRecords).ToList();
            View.TotalRecords = totalRecords;
        }

        #endregion

    }
}
